package com.example.tianling.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.tianling.common.params.*;
import com.example.tianling.common.vo.*;
import com.example.tianling.entity.InterviewInfoEntity;
import com.example.tianling.entity.UserEntity;
import org.json.JSONException;;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface UserService extends IService<UserEntity> {
    boolean sendSMS (String mobile, String code) throws Exception;
    void register(RegisterDo registerDo);
    Integer passwordLogin(String mobile, String password);
    Integer smscodeLogin(String mobile, String code);
    void updateUserInfo(UpdateUserInfoDo updateUserInfoDo, UserEntity user) throws IOException;
    UserEntity getUserByUserId(Integer userId);
    Integer updateUserState(UpdateUserStateDo updateUserStateDo, UserEntity user);
    List<Map<String, Object>> getCountByArea();
    void updateFollowNum(Integer userId, Boolean isIncrease);
    void updateFansNum(Integer userId, Boolean isIncrease);
    IntervierInfoVo getInterviewInfo(Integer userId) throws JSONException;

    Integer insertOrUpdateInterLike(Integer userId, IntervierInfoLikeVo intervierInfoLikeVo);

    Integer insertOrUpdateInterInfo(Integer userId, InterviewInfoEntity interviewInfoEntity);
    InterDetailVo get_interviewInfo(Integer userId);
    InterviewTagVo get_interviewTag(Integer userId);

    void updateUrl(String oldUrl, String newUrl);

    // 小程序相关接口
    WxUserVo wxLogin(String code) throws Exception;
    WxUserVo wxRegister(String code, String openId) throws IOException;
    void updateWxUserInfo(UpdateUserInfoDo updateUserInfoDo, UserEntity user) throws IOException;
}
